package com.sky.controller.user;

import com.sky.handler.RedisUtil;
import com.sky.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user/shop")
@Api(tags = "营业状态")
@Slf4j
public class ststus {
    @Autowired
    private RedisUtil redisUtil;
    @GetMapping("/status")
    @ApiOperation("营业状态")
    public Result<Integer> statuss(){
        log.info("status:{}",redisUtil.get("shop:status"));
        //获取营业状态
        Integer o = (Integer) redisUtil.get("shop:status");
        return Result.success(o);
    }
}
